﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using WPF项目.ViewModels;

namespace WPF项目.Views
{
    /// <summary>
    /// MainView.xaml 的交互逻辑
    /// </summary>
    public partial class MainView : Window
    {
        public MainView()
        {
            InitializeComponent();
         


            Minimize.Click += (s, e) => {

                Application.Current.MainWindow.WindowState = WindowState.Minimized;
            };// 当前窗口最小化
            maximize.Click += (s, e) => // 当前窗口最大化
            {
                if (this.WindowState == WindowState.Maximized)
                {
                    Application.Current.MainWindow.WindowState = WindowState.Normal;
                }
                else
                {
                    Application.Current.MainWindow.WindowState = WindowState.Maximized;
                }

            };
            Shut.Click += (s, e) => { this.Close(); };// 关闭当前窗口
            ColorZone.MouseMove += (s, e) => {
                if (e.LeftButton == MouseButtonState.Pressed)
                {
                    this.DragMove();// 用户通过鼠标拖动来移动窗口
                }

            };// 鼠标拖动事件
            ColorZone.MouseDoubleClick += (s, e) => {
                if (this.WindowState == WindowState.Normal)
                {
                    Application.Current.MainWindow.WindowState = WindowState.Maximized;
                }
                else
                {
                    Application.Current.MainWindow.WindowState = WindowState.Normal;
                }

            };
            menuBar.SelectionChanged += (s, e) =>
            {
                drawerHost.IsLeftDrawerOpen = false;
            };
            /*this.dialogHostService = dialogHostService;*/
        }
    }
}
